<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        公告列表删除恢复
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="/static/css/x-admin.css" media="all">
    <link rel="stylesheet" href="/static/lib//layui/css/layui.css">
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>轮播列表</cite></a>
              <a><cite>恢复图片</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<!--        <div class="x-body">-->
{if condition="$info eq null"}
<blockquote class="layui-elem-quote">暂无删除的图片</blockquote>
{else}
<xblock style="height: 30px">
    <span class="x-right" style="line-height:30px;margin-right: 15px">共有数据：<span class="layui-badge">{$count}</span> 条</span>
</xblock>
<table class="layui-table">
    <thead>
    <tr>
        <th>
            ID
        </th>
        <th>
            图片
        </th>
        <th>
            前台显示位置
        </th>
        <th>
            操作
        </th>
    </tr>
    </thead>
    <tbody>
    {foreach name="info" id="v"}
    <tr>
        <td>
            {$v.id}
        </td>

        <td >
            <img src="{$v.img}" style="max-width: 150px" alt="">
        </td>
        {if condition='$v.position eq 1'}
        <td>
            首页标题
        </td>
        {elseif condition='$v.position eq 2'}
        <td>
            banner轮播
        </td>
        {else/}
        <td>
            首页资讯
        </td>
        {/if}
        <td class="td-manage">
            <a title="恢复" href="javascript:;" onclick="member_del('{$v.id}','{$v.delete}')"
               style="text-decoration:none">
                <i class="layui-icon">&#xe857;</i>
            </a>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
{/if}
<!--        </div>-->
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script src="/static/js/x-layui.js" charset="utf-8"></script>
<script>
    layui.use(['element','layer','form'], function(){
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层
        form = layui.form();
    })

    function member_del(id,obj) {
        layer.confirm('确定要恢复该图片吗？',{icon:3,title:'提示信息'},function(index){
            $.ajax({
                url:"{:url('bannerDeletes')}",
                data:{id:id,delete:obj},
                type:'post',
                success:function (res) {
                    if (res.code == 100){
                        layer.msg(res.msg, {icon: 6,time:2000},function () {
                            window.parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                        return false;
                    }else{
                        layer.msg(res.msg,{icon:7,time:1000});
                        return false;
                    }
                }
            })
        });
    }
</script>

</body>
</html>